import service from "@/utils/request";
import { AxiosPromise } from "axios";
import { allStatisticsVo, B2cChannelVo } from "./type";

enum API {
  allStatistics = "/api/ais/all/statistics",
  b2cChannelStatistics = `/api/ais/all/b2c/channel/statistics`,
  b2cGoodsStatistics = "/api/ais/all/b2c/goods/statistics",
  allO2oStatistics = "/api/ais/all/o2o/statistics",
  o2oChannelStatistics = "/api/ais/all/o2o/channel/statistics",
  o2oGoodsStatistics = "/api/ais/all/o2o/goods/statistics",
  o2oShopStatistics = "/api/ais/all/o2o/shop/statistics",
  specialCommodityStatistics = "/api/ais/all/special/commodity/statistics",
  chainSpecialGoodsStatistics = "/api/ais/all/chain/special/goods/statistics",
  chainsShops = "/api/ais/all/chains/shops",
  shopSpecialGoodsStatistics = "/api/ais/all/shop/special/goods/statistics",
  specialActivitiesStatistics = "/api/ais/all/chain/activities/statistics",
  specialGoodsCountStatistics = "/api/ais/all/chain/special/goods/count/statistics",
}

// 驾驶仓统计接口-最高层级统计
export const allStatistics = (data: allStatisticsVo): AxiosPromise<any> => {
  return service({
    url: API.allStatistics,
    method: "post",
    data,
  });
};

// 驾驶仓统计接口-B2C渠道统计明细
export const b2cChannelStatistics = (data: B2cChannelVo): AxiosPromise<any> => {
  return service({
    url: API.b2cChannelStatistics,
    method: "post",
    data,
  });
};

// 驾驶仓统计接口-分页B2C商品排行统计明细
export const b2cGoodsStatistics = (data: any): AxiosPromise<any> => {
  return service({
    url: API.b2cGoodsStatistics,
    method: "post",
    data,
  });
};

// 驾驶仓统计接口-O2o连锁统计
export const allO2oStatistics = (data: any): AxiosPromise<any> => {
  return service({
    url: API.allO2oStatistics,
    method: "post",
    data,
  });
};

// 驾驶仓统计接口-O2O渠道统计明细
export const o2oChannelStatistics = (data: any): AxiosPromise<any> => {
  return service({
    url: API.o2oChannelStatistics,
    method: "post",
    data,
  });
};

// 驾驶仓统计接口-O2O商品统计明细
export const o2oGoodsStatistics = (data: any): AxiosPromise<any> => {
  return service({
    url: API.o2oGoodsStatistics,
    method: "post",
    data,
  });
};

// 驾驶仓统计接口-O2O门店渠道统计明细
export const o2oShopStatistics = (data: any): AxiosPromise<any> => {
  return service({
    url: API.o2oShopStatistics,
    method: "post",
    data,
  });
};

// 驾驶仓统计接口-特殊商品主页
export const specialCommodityStatistics = (data: any): AxiosPromise<any> => {
  return service({
    url: API.specialCommodityStatistics,
    method: "post",
    data,
  });
};

// 驾驶仓统计接口-特殊商品连锁销售数据明细
export const chainSpecialGoodsStatistics = (data: any): AxiosPromise<any> => {
  return service({
    url: API.chainSpecialGoodsStatistics,
    method: "post",
    data,
  });
};

// 驾驶仓统计接口-特殊商品连锁销售查询所有店铺
export const chainsShops = (data: any): AxiosPromise<any> => {
  return service({
    // url: API.chainsShops + `/${id}`,
    url: API.chainsShops,
    method: "post",
    data,
  });
};

// 驾驶仓统计接口-特殊商品各连锁店铺详情 
export const shopSpecialGoodsStatistics = (data: any): AxiosPromise<any> => {
  return service({
    url: API.shopSpecialGoodsStatistics,
    method: "post",
    data,
  });
};

// 驾驶仓统计接口-特殊商品连锁数据活动明细
export const specialActivitiesStatistics = (data: any): AxiosPromise<any> => {
  return service({
    url: API.specialActivitiesStatistics,
    method: "post",
    data,
  });
};

// 驾驶仓统计接口-特殊商品连锁数据列表
export const specialGoodsCountStatistics = (data: any): AxiosPromise<any> => {
  return service({
    url: API.specialGoodsCountStatistics,
    method: "post",
    data,
  });
};
